class Solution {
public:
    ListNode* reverseBetween(ListNode* head, int left, int right) {
        ListNode *cur = head;
        ListNode *pre = NULL, *start=NULL, *end=NULL;
        int pos = 1;
        for(;cur;++pos) {
            if(pos<left) {    
                start = cur;
…        if(pos>=right) {  
            if(start) {
                start->next = pre;
                pre = head;    
            }
            if(end) end->next = cur;
        }
        return pre;
    }
};